home *** CD-ROM | disk | FTP | other *** search
- public class ClassBreakable extends Codex {
- private CodexThing _gib1;
- private CodexThing _gib2;
- private CodexThing _gib3;
- private CodexThing _gib4;
- private CodexThing _gib5;
- private float[] velocity = new float[3];
- private float[] rotVelocity = new float[3];
- private boolean _bTriggered;
- public static String[] _params = new String[]{"Gib 1", "Gib 2", "Gib 3", "Gib 4", "Gib 5", "Velocity X", "Velocity Y", "Velocity Z", "Rotational Velocity X", "Rotational Velocity Y", "Rotational Velocity Z"};
-
- public void beginscene(int clientGuid, int captureID) {
- if (!this._bTriggered) {
- float[] tempVel = new float[3];
- float[] tempRotVel = new float[3];
- tempVel[0] = this.velocity[0] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempVel[1] = this.velocity[1] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempVel[2] = this.velocity[2] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- this._gib1.SetVelocity(tempVel);
- tempRotVel[0] = this.rotVelocity[0] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempRotVel[1] = this.rotVelocity[1] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempRotVel[2] = this.rotVelocity[2] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- this._gib1.SetRotVelocity(tempRotVel);
- this._gib1.SetPhysicsFlags(8);
- tempVel[0] = this.velocity[0] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempVel[1] = this.velocity[1] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempVel[2] = this.velocity[2] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- this._gib2.SetVelocity(tempVel);
- tempRotVel[0] = this.rotVelocity[0] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempRotVel[1] = this.rotVelocity[1] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempRotVel[2] = this.rotVelocity[2] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- this._gib2.SetRotVelocity(tempRotVel);
- this._gib2.SetPhysicsFlags(8);
- tempVel[0] = this.velocity[0] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempVel[1] = this.velocity[1] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempVel[2] = this.velocity[2] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- this._gib3.SetVelocity(tempVel);
- tempRotVel[0] = this.rotVelocity[0] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempRotVel[1] = this.rotVelocity[1] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempRotVel[2] = this.rotVelocity[2] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- this._gib3.SetRotVelocity(tempRotVel);
- this._gib3.SetPhysicsFlags(8);
- tempVel[0] = this.velocity[0] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempVel[1] = this.velocity[1] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempVel[2] = this.velocity[2] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- this._gib4.SetVelocity(tempVel);
- tempRotVel[0] = this.rotVelocity[0] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempRotVel[1] = this.rotVelocity[1] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempRotVel[2] = this.rotVelocity[2] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- this._gib4.SetRotVelocity(tempRotVel);
- this._gib4.SetPhysicsFlags(8);
- tempVel[0] = this.velocity[0] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempVel[1] = this.velocity[1] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempVel[2] = this.velocity[2] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- this._gib5.SetVelocity(tempVel);
- tempRotVel[0] = this.rotVelocity[0] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempRotVel[1] = this.rotVelocity[1] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- tempRotVel[2] = this.rotVelocity[2] * (float)Math.random() * (float)(Math.random() < (double)0.5F ? -1 : 1);
- this._gib5.SetRotVelocity(tempRotVel);
- this._gib5.SetPhysicsFlags(8);
- }
-
- }
-
- public ClassBreakable(CodexThing gib1, CodexThing gib2, CodexThing gib3, CodexThing gib4, CodexThing gib5, float velX, float velY, float velZ, float rotVelX, float rotVelY, float rotVelZ) {
- this._gib1 = new CodexThing(((Codex)gib1).GetGUID());
- this._gib2 = new CodexThing(((Codex)gib2).GetGUID());
- this._gib3 = new CodexThing(((Codex)gib3).GetGUID());
- this._gib4 = new CodexThing(((Codex)gib4).GetGUID());
- this._gib5 = new CodexThing(((Codex)gib5).GetGUID());
- this.velocity[0] = velX;
- this.velocity[1] = velY;
- this.velocity[2] = velZ;
- this.rotVelocity[0] = rotVelX;
- this.rotVelocity[1] = rotVelY;
- this.rotVelocity[2] = rotVelZ;
- }
-
- public void triggered(int triggeredGUID, int triggererGUID, int triggerID, float p0, float p1, float p2, float p3, int captureID) {
- this._bTriggered = true;
- this._gib1.ClearPhysicsFlags(8);
- this._gib2.ClearPhysicsFlags(8);
- this._gib3.ClearPhysicsFlags(8);
- this._gib4.ClearPhysicsFlags(8);
- this._gib5.ClearPhysicsFlags(8);
- }
- }
-